package activities;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import bookless.pakage.R;
import bookless.pakage.UserHandler;

public class AdminActivity extends Activity{

	private static Context context;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.admin);
		context = AdminActivity.this;

    Button viewUsers;
    viewUsers = (Button)findViewById(R.id.viewUsers);
    viewUsers.setOnClickListener(new View.OnClickListener() {
    
    	@Override
    	public void onClick(View v) {
		startActivity(new Intent("bookless.pakage.VIEWDB"));
    	}
    });
    	
    Button viewBooks;
    viewBooks = (Button)findViewById(R.id.viewBooks);
    viewBooks.setOnClickListener(new View.OnClickListener() {
    
    	@Override
    	public void onClick(View v) {
  
 		startActivity(new Intent("bookless.pakage.VIEWBOOKDB"));
    	}
    });
    
    Button viewUserBookDB;
    viewUserBookDB = (Button)findViewById(R.id.viewConnection);
    viewUserBookDB.setOnClickListener(new View.OnClickListener() {
    
    	@Override
    	public void onClick(View v) {
    		
 		startActivity(new Intent("bookless.pakage.VIEWUSERBOOKDB"));
    	}
    }); 
    
    Button removeUsers;
    removeUsers = (Button)findViewById(R.id.removeAllUsers);
    removeUsers.setOnClickListener(new View.OnClickListener() {
    
    	@Override
    	public void onClick(View v) {
    		
 		UserHandler.removeAllUsers();
    	}
    });
}

	public static Context getContext() {
		return context;
	}
	

	
}